clear all

** Set working directory: please set your own
/*
cd "~/Dropbox/sanctions_replication/"
*/
** Open dataset
use data/survey_clean.dta, clear

* Run the analyses
* Physical sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_phis_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_phis_sociodem

* Physical sanctions, attitudes and emotions
regr intent_phis_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_phis_attitudes

* Verbal sanctions, sociodemographics (Madrid is ref category for regions)
regr intent_verb_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_verbal_sociodem

* Verbal sanctions, attitudes and emotions
regr intent_verb_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_verbal_attitudes

* Insult, sociodemographics (Madrid is ref category for regions)
regr intent_insult_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_insult_sociodem

* Insult, attitudes and emotions
regr intent_insult_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_insult_attitudes

* PCA direct sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_direct_up female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store pca_direct_sociodem_up

* PCA direct sanctions, attitudes and emotions
regr pca_direct_up left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store pca_direct_attitudes_up

* Deny help, sociodemographics (Madrid is ref category for regions)
regr intent_deny_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_deny_sociodem

* Deny help, attitudes and emotions
regr intent_deny_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_deny_attitudes

* Avoid Interaction, sociodemographics (Madrid is ref category for regions)
regr intent_avoid_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_avoid_sociodem

* Avoid Interaction, attitudes and emotions
regr intent_avoid_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_avoid_attitudes

* Gossip, sociodemographics (Madrid is ref category for regions)
regr intent_gossip_up_num female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store up_gossip_sociodem

* Gossip, attitudes and emotions
regr intent_gossip_up_num left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store up_gossip_attitudes

* PCA indirect sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_indirect_up female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store pca_indirect_sociodem_up

* PCA indirect sanctions, attitudes and emotions
regr pca_indirect_up left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store pca_indirect_attitudes_up

* PCA all sanctions, sociodemographics (Madrid is ref category for regions)
regr pca_all_up female_dummy age_calculated college spanish vote_podemos_ccaa, r
est store pca_all_sociodem_up

* PCA all sanctions, attitudes and emotions
regr pca_all_up left_right_self pol_interest anger_up_num disgust_up_num  ///
fear_up_num sad_up_num, r
est store pca_all_attitudes_up

* Make table
esttab up_phis_sociodem up_phis_attitudes up_verbal_sociodem up_verbal_attitudes up_insult_sociodem up_insult_attitudes pca_direct_sociodem_up pca_direct_attitudes_up up_gossip_sociodem up_gossip_attitudes ///
up_deny_sociodem up_deny_attitudes up_avoid_sociodem up_avoid_attitudes ///
pca_indirect_sociodem_up pca_indirect_attitudes_up  pca_all_sociodem_up pca_all_attitudes_up  ///
using tables/tableb12.tex, tex nonumber ///
mtitles("Physical" "Physical" "Verbal" "Verbal" "Insult" "Insult"  "Dir sanct (PCA)" "Dir sanct (PCA)" "Gossip" "Gossip" "Deny help" "Deny help" "Avoid interact" "Avoid interact" "Ind sanct (PCA)" "Ind sanct (PCA)" "All sanctions (PCA)" "All sanctions (PCA)" ) ///
coeflabels(left_right_self "Left-right self placement" ///
female_dummy "Female (dummy)" age_calculated "Age" college "College" spanish "Spanish"  vote_podemos_ccaa "Podemos vote in Region" ///
pol_interest "Political interest" ///
anger_up_num "Anger" disgust_up_num "Disgust" fear_up_num "Fear" sad_up_num "Sadness" _cons "Constant") se ///
replace addnotes("Standard errors are robust")
